<template>
  <div>
    <el-row type="flex" align="middle">
      <el-col :span="4">
        <el-image :src="src" style="height: 100px; width: 280px"></el-image>
      </el-col>
      <el-col :span="12" :offset="8">
        <el-input
            placeholder="请输入内容"
            v-model="selectData"
            clearable style="width: 500px">
        </el-input>
        <el-button type="primary" @click="handleSelect" >搜 索</el-button>
      </el-col>
    </el-row>
    <el-divider></el-divider>
    <el-menu :default-active="activeIndex" mode="horizontal"
             style="display: flex;flex-direction: row;justify-content: center" router>
      <el-menu-item index="/home">首页</el-menu-item>
      <el-menu-item index="/computer">电脑软件</el-menu-item>
      <el-menu-item index="/phone">安卓软件</el-menu-item>
      <el-menu-item index="/necessary">装机必备</el-menu-item>
      <el-menu-item index="/fileRank">下载排行</el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  name: "Header",
  data() {
    return {
      activeIndex: '',
      src: require('../assets/易下.png'),
      selectData: ''
    }
  },
  mounted() {
    this.activeIndex = window.location.pathname
  },
  methods: {
    handleSelect() {
      this.$router.push({name: "FileInfo", params: {selectData: this.selectData}})
    }
  }
}
</script>

<style scoped>
.el-divider--horizontal {
  margin-top: 0;
  margin-bottom: 0;
}
</style>
